<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport"
	content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<title>地址管理</title>
<link href="css/style2zc.css" rel="stylesheet" type="text/css">
<link href="css/type.css" rel="stylesheet" type="text/css">
<style type="text/css">
/*<![CDATA[*/
* html .decoration {
	position: absolute;
	right: 16px;
	top: 0;
} /*only for ie*/
/*]]>*/
</style>
<!-- Do not move the bellow script to custom.js! It must stay here to
    load properly! -->
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/jquerysession.js"></script>
<script type="text/javascript" src="scripts/custom2zc.js" charset="utf-8"></script>
<script type="text/javascript" src="scripts/layer/layer.m.js"></script>
</head>
<body onLoad="loadImages()">
	<p class="no-mobile">
		请使用手机访问本页面！ <br /> 这个页面是专门针对手机设计的！
	</p>
	<div class="site">
		<div id="hidepage">
			<p class="center-text">
				加载中，请耐心等待! <br /> 
				<img src="images/background/130.gif" alt="load">
			</p>
		</div>
		<div class="decoration">
			<div class="back">
				<a href="javascript:history.back(-1)">
					<img src="images/home/back.png">
				</a>
			</div> 
			<p class="title" style="width: 33%;float: left;">地址管理</p>
				<div style="width: 33%">
			</div> 
		</div>
		<div id="wrapper">
			<c:if test="${requestScope.list.size()==0}">
				<div id="order">
					<div class="order_no_order">
						<img src='images/order/no_order_03.png'>
					</div>
					<div>
						<font color="#323232">您还没有相关地址！</font>
					</div>
					<div class="order_to_order">
						<a href="web2zc/person/addrNew.jsp?areaId=${areaId}&area=${area}">
							<img src='images/person/add_addr.png'>
						</a>
					</div>
				</div>
			</c:if>
			<c:if test="${requestScope.list.size()>0}">
			<p class="addr_title">默认地址</p>
			<c:forEach var="e" items="${requestScope.list}" varStatus="status">
			<c:if test="${e.def=='1'}">
				<div class="addrbox addrboxCheck" aid="${e.id}" style="background-color: #7ecef4" onclick="choiceaddr(this)">
					<div class="btn_choice">
						<img  class="choiceimg" src="images/person/choice.png">
					</div>
					<div class="address">
						<div class="addressconent">
							<p class="home_name">${e.userName}</p>
							<p class="tel">${e.userMp}</p>
							<p class="addressStr">${e.area}${e.address}</p>
						</div>
						<div class="btns">
							<div class="btn_update" >
								<a href="transaction2zcRouter?funcID=0033&id=${e.id}">
								<img src="images/person/modify.png">
								</a>
							</div>
							<div class="btn_del" addrID="${e.id}">
								<a href="transaction2zcRouter?funcID=0035&id=${e.id}&areaId=${e.areaId}">
								<img src="images/person/delete.png">
								</a>
							</div>
						</div>
					</div>
				</div>
				<div class="line"><img src="images/home/line_03.png"></div>
				<div style="clear:both"></div>	
			</c:if>
			<c:if test="${e.def=='0'}">
					<div class="addrbox" aid="${e.id}" onclick="choiceaddr(this)">
						<div class="btn_choice">
							<img class="choiceimg" src="images/person/no_choice.png">
						</div>
						<div class="address">
							<div class="addressconent">
								<p class="home_name">${e.userName}</p>
								<p class="tel">${e.userMp}</p>
								<p class="addressStr">${e.area}${e.address}</p>
							</div>
							<div class="btns">
								<div class="btn_update" addrID="${e.id}">
									<a href="transaction2zcRouter?funcID=0033&id=${e.id}">
										<img src="images/person/modify.png">
									</a>
								</div>
								<div class="btn_del" addrID="${e.id}">
									<a href="transaction2zcRouter?funcID=0035&id=${e.id}&areaId=${e.areaId}">
										<img src="images/person/delete.png">
									</a>
								</div>
							</div>
						</div>
					</div>
				</c:if>
			</c:forEach>
			<div class="btn_do">
				<div class="btn_newadded">
					<a  href="web2zc/person/addrNew.jsp?areaId=${areaId}&area=${area}">
					<img src="images/person/newadded.png">
					</a>
				</div>
				<div class="btn_complete">
					<a href="javascript:void(0)" onclick="cutAddr()">
					<%-- <a  href="transaction2zcRouter?funcID=0036&id=${e.id}"> --%>
					<img src="images/person/complete.png">
					</a>
				</div>
			</div>
			</c:if>
		</div>
	</div>
	<script type="text/javascript">
		function cutAddr(){
			var id=$(".addrboxCheck").attr("aid");
			//location.replace("index.jsp");
			if(typeof id == "undefined"){
				layer.open({content: '请选择地址！',time: 2}); 
				return;
			}
			location.href="transaction2zcRouter?funcID=0036&id="+id;
		}
	</script>
</body>
</html>